﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ProgramaPuentePudahuel.App.BO;
using ProgramaPuentePudahuel.App.BLL;
using ProgramaPuentePudahuel.App.DAL;


/// <summary>
/// Summary description for BeneficiarioManager
/// </summary>
namespace ProgramaPuentePudahuel.App.BLL
{
    [DataObjectAttribute()]
    public class BeneficiarioManager
    {

        #region Public Methods

        public BeneficiarioManager()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        [DataObjectMethod(DataObjectMethodType.Select, true)]
        public static BeneficiarioList GetList(string id)
        {
            return BeneficiarioDB.GetList(id);
        }

        [DataObjectMethod(DataObjectMethodType.Select, false)]
        public static Beneficiario GetItem(String id)
        {
            return BeneficiarioDB.GetItem(id);
        }

        [DataObjectMethod(DataObjectMethodType.Insert, true)]
        public static int Add(Beneficiario myBeneficiario)
        {
            return BeneficiarioDB.Add(myBeneficiario);
        }
        [DataObjectMethod(DataObjectMethodType.Update,true)]
        public static int Edit(Beneficiario myBeneficiario)
        {
            int nRowsAfected = BeneficiarioDB.Save(myBeneficiario);
            return nRowsAfected;
        }

        [DataObjectMethod(DataObjectMethodType.Delete, true)]
        public static bool Delete(Beneficiario myBeneficiario)
        {
           return BeneficiarioDB.Delete(myBeneficiario.rut2);
           
        }
        

        #endregion
    }
}